<template>
  <div>
    <el-card>
      <el-button type="primary" @click="fan">返回</el-button>
      <h3>试卷名称:{{ kaoti.sjname }}</h3>
      <p v-for="(i,index) of kaoti.que" :key="index">
        <span>题目:{{ i.title }} </span>
        <span>({{ i.score }}分)</span>
      </p>
    </el-card>
  </div>
</template>

<script>
export default {
  components: {},
  props: {},
  data() {
    return {
      kaoti: {}
    }
  },
  computed: {},
  watch: {},
  async created() {
    var res = await this.http.get('/test/test/', {
      params: {
        id: this.$route.query.id,
        page: 1,
        size: 3
      }
    })
    console.log(res)
    if (res.data.code == 200) {
      this.kaoti = res.data.data[0]
    }
  },
  mounted() {},
  methods: {
    fan() {
      this.$router.go(-1)
    }
  }
}
</script>
<style scoped>
    .el-card p{
      font-size: 18px;
      margin-top: 5px;
    }
    .el-card .el-button{
      float: right;
    }
</style>
